/*
 * @Author: xiawang1024
 * @Date: 2023-04-10 15:41:02
 * @LastEditTime: 2023-04-10 16:24:52
 * @LastEditors: xiawang1024
 * @Description:
 * @FilePath: /rollup-lib/src/index.js
 * 工作，生活，健康
 */
import { wxSdkInit, getOriginWx, shareInit } from './utils/weixin'
class WeChat {
  constructor(appId, shareObj) {
    WeChat.#sdkInit(appId)
    shareObj && this.share(shareObj)
  }

  static #sdkInit(appId) {
    wxSdkInit(appId)
  }

  static getWx() {
    return getOriginWx()
  }

  share({ title, desc, imgUrl }) {
    shareInit({ title, desc, imgUrl })
  }
}

export default WeChat
